CVE-2024-39930
Gogs SSH Server Argument Injection RCE
Description
The built-in SSH server of Gogs through 0.13.0 allows argument injection in internal/ssh/ssh.go, leading to remote code execution. Authenticated attackers can exploit this by opening an SSH connection and sending a malicious --split-string env request if the built-in SSH server is activated. Windows installations are unaffected.
INFO
Published Date :
July 4, 2024, 4:15 p.m.
Last Modified :
April 11, 2025, 3:14 p.m.
Remotely Exploit :
Yes !
Source :
[email protected]
CVSS Scores
| Score | Version | Severity | Vector | Exploitability Score | Impact Score | Source | 
|---|---|---|---|---|---|---|
| CVSS 3.1 | CRITICAL | [email protected] | ||||
| CVSS 3.1 | CRITICAL | [email protected] | 
Solution
- Update the affected packages.
Public PoC/Exploit Available at Github
                                            CVE-2024-39930 has a 5 public
                                            PoC/Exploit available at Github.
                                            Go to the Public Exploits tab to see the list.
                                        
References to Advisories, Solutions, and Tools
                                            Here, you will find a curated list of external links that provide in-depth
                                            information, practical solutions, and valuable tools related to
                                            CVE-2024-39930.
                                        
| URL | Resource | 
|---|---|
| https://github.com/gogs/gogs/releases | Release Notes | 
| https://www.sonarsource.com/blog/securing-developer-tools-unpatched-code-vulnerabilities-in-gogs-1/ | Third Party Advisory | 
| https://www.vicarius.io/vsociety/posts/argument-injection-in-gogs-ssh-server-cve-2024-39930 | Exploit Third Party Advisory | 
| https://github.com/gogs/gogs/releases | Release Notes | 
| https://www.sonarsource.com/blog/securing-developer-tools-unpatched-code-vulnerabilities-in-gogs-1/ | Third Party Advisory | 
| https://www.vicarius.io/vsociety/posts/argument-injection-in-gogs-ssh-server-cve-2024-39930 | Exploit Third Party Advisory | 
CWE - Common Weakness Enumeration
            While CVE identifies
            specific instances of vulnerabilities, CWE categorizes the common flaws or
            weaknesses that can lead to vulnerabilities. CVE-2024-39930 is
            associated with the following CWEs:
        
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
            (CAPEC)
            stores attack patterns, which are descriptions of the common attributes and
            approaches employed by adversaries to exploit the CVE-2024-39930
            weaknesses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
None
Rust
Gogs Under Attack: Unpacking the Critical SSH Vulnerability (CVE-2024–39930)
Python
Exploit Code for CVE-2024-39930 gogs ssh server RCE
Python Shell
CVE POC repo 자동 수집기
Python
None
HTML Python Shell
Results are limited to the first 15 repositories due to potential performance issues.
			The following list is the news that have been mention
			CVE-2024-39930 vulnerability anywhere in the article.
		
- 
                                                            
                                                                Cybersecurity News 
Critical Vulnerabilities Found in Gogs Self-Hosted Git Service: Urgent Update Required
Multiple critical security vulnerabilities have been discovered in Gogs, a popular open-source self-hosted Git service. These vulnerabilities, with CVSS scores ranging from 7.7 to 9.9, could allow att ... Read more
                The following table lists the changes that have been made to the
                CVE-2024-39930 vulnerability over time.
            
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
- 
                            Initial Analysis by [email protected]Apr. 11, 2025 Action Type Old Value New Value Added CVSS V3.1 AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H Added CPE Configuration OR *cpe:2.3:a:gogs:gogs:*:*:*:*:*:*:*:* versions up to (including) 0.13.0 Added Reference Type CVE: https://github.com/gogs/gogs/releases Types: Release Notes Added Reference Type MITRE: https://github.com/gogs/gogs/releases Types: Release Notes Added Reference Type CVE: https://www.sonarsource.com/blog/securing-developer-tools-unpatched-code-vulnerabilities-in-gogs-1/ Types: Third Party Advisory Added Reference Type MITRE: https://www.sonarsource.com/blog/securing-developer-tools-unpatched-code-vulnerabilities-in-gogs-1/ Types: Third Party Advisory Added Reference Type CVE: https://www.vicarius.io/vsociety/posts/argument-injection-in-gogs-ssh-server-cve-2024-39930 Types: Exploit, Third Party Advisory Added Reference Type MITRE: https://www.vicarius.io/vsociety/posts/argument-injection-in-gogs-ssh-server-cve-2024-39930 Types: Exploit, Third Party Advisory 
- 
                            CVE Modified by af854a3a-2127-422b-91ae-364da2661108Nov. 21, 2024 Action Type Old Value New Value Added Reference https://github.com/gogs/gogs/releases Added Reference https://www.sonarsource.com/blog/securing-developer-tools-unpatched-code-vulnerabilities-in-gogs-1/ Added Reference https://www.vicarius.io/vsociety/posts/argument-injection-in-gogs-ssh-server-cve-2024-39930 
- 
                            CVE Modified by [email protected]Aug. 28, 2024 Action Type Old Value New Value Added Reference MITRE https://www.vicarius.io/vsociety/posts/argument-injection-in-gogs-ssh-server-cve-2024-39930 [No types assigned] 
- 
                            CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0Aug. 12, 2024 Action Type Old Value New Value Added CWE CISA-ADP CWE-88 
- 
                            CVE Received by [email protected]Jul. 04, 2024 Action Type Old Value New Value Added Description The built-in SSH server of Gogs through 0.13.0 allows argument injection in internal/ssh/ssh.go, leading to remote code execution. Authenticated attackers can exploit this by opening an SSH connection and sending a malicious --split-string env request if the built-in SSH server is activated. Windows installations are unaffected. Added Reference MITRE https://github.com/gogs/gogs/releases [No types assigned] Added Reference MITRE https://www.sonarsource.com/blog/securing-developer-tools-unpatched-code-vulnerabilities-in-gogs-1/ [No types assigned] Added CVSS V3.1 MITRE AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H 
 
                                             
                                            